import 'package:flutter_duqin/models/recommend_interface.dart';

/// 用户列表模型
class UserList {
  final List<UserItem> list;

  UserList(this.list);

  factory UserList.fromJson(List<dynamic> list) {
    return UserList(
      list.map((item) => UserItem.fromJson(item)).toList(),
    );
  }
}

/// 用户模型
class UserItem implements RecommendInterface {
  final int id;
  final String coverPictureUrl;
  final int musicCount;
  final int musicPlayCount;
  final String nickname;
  final String type;

  UserItem({
    required this.id,
    required this.coverPictureUrl,
    required this.musicCount,
    required this.musicPlayCount,
    required this.nickname,
    required this.type,
  });

  factory UserItem.fromJson(dynamic item) {
    return UserItem(
        id: item['id'],
        coverPictureUrl: item['coverPictureUrl'],
        musicCount: item['musicCount'],
        musicPlayCount: item['musicPlayCount'],
        nickname: item['nickname'],
        type: item['type']);
  }
}
